#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cmath>
using namespace std;

const int N = 1e6 + 10;
int num[N], a[N], b[N];
int lx, ly, lz;

int main()
{
	string x, y; cin >> x >> y;
	lx = x.size(), ly = y.size(), lz = max(lx, ly);
	int flag = 1;
	if (ly > lx)
	{
		cout << '-';
		flag = 0;
	}
	else if (ly = lx)
	{
		if (x[lx - 1] < y[ly - 1]) cout << '-';
		flag = 0;
	}
	for (int i = 0; i < lx; i++)
		a[i] = x[lx - 1 - i] - '0';
	for (int i = 0; i < ly; i++)
		b[i] = y[ly - 1 - i] - '0';
	if (flag)
	{
		for (int i = 0; i < lz; i++)
		{
			num[i] += a[i] - b[i];
			if (num[i] < 0)
			{
				num[i] += 10;
				num[i + 1] -= 1;
			}
		}
	}
	else
	{
		for (int i = 0; i < lz; i++)
		{
			num[i] += b[i] - a[i];
			if (num[i] < 0)
			{
				num[i] += 10;
				num[i + 1] -= 1;
			}
		}
	}
	for (int i = lz - 1; i >= 0; i--)
	{
		cout << num[i];
	}
	return 0;
}